package net.mingsoft.base.resolver;

import org.springframework.web.multipart.commons.*;
import javax.servlet.http.*;

public class MultipartResolver extends CommonsMultipartResolver
{
    private String excludeUrls;
    private String[] excludeUrlArray;
    
    public String getExcludeUrls() {
        return this.excludeUrls;
    }
    
    public void setExcludeUrls(final String excludeUrls) {
        this.excludeUrls = excludeUrls;
        this.excludeUrlArray = excludeUrls.split(",");
    }
    
    public boolean isMultipart(final HttpServletRequest request) {
        for (final String url : this.excludeUrlArray) {
            if (request.getRequestURI().contains(url)) {
                return false;
            }
        }
        return super.isMultipart(request);
    }
}
